<div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
    <table>
        <tbody>
        <volist name="txList" id="list">
            <tr data-id="{$list['id']}">
                <td class="sign">
                    <div style="width: 24px;"><i class="ico-check"></i></div>
                </td>
                <td align="left" class="">
                    <div style="text-align: center; width: 60px;">{$list.id}</div>
                </td>
                <td align="left" class="">
                    <div style="text-align: center; width: 70px;">{$list.nickname}</div>
                </td>
                <td align="left" class="">
                    <div style="text-align: center; width: 100px;">{$list.money}</div>
                </td>
                <td align="left" class="">
                    <div style="text-align: center; width: 100px;" class="statename">{$list.statename}</div>
                </td>
                <td align="left" class="">
                    <div style="text-align: center; width: 120px;">{$list.add_time|date='Y-m-d H:i',###}</div>
                </td>
                <td align="center" class="handle">
                    <div style="text-align: center; width: 170px; max-width:250px;">
                        <if condition='$list[type] eq 0'>
                         <a class="btn " onClick="changeState('<?php echo $list['id']; ?>',1,this)"><i class="fa fa-check-circle  yes"></i>通过</a>
                         <a class="btn no" onClick="changeState('<?php echo $list['id']; ?>',2,this)"><i class="fa fa-ban"></i>拒绝</a>
                        </if>
                    </div>
                </td>
                <td align="" class="" style="width: 100%;">
                    <div>&nbsp;</div>
                </td>
            </tr>
        </volist>
        </tbody>
    </table>
</div>
<!--分页位置-->
{$pager->show()}
<script>
    $(".pagination  a").click(function(){
        var page = $(this).data('p');
        ajax_get_table('search-form2',page);
    });
    $(document).ready(function(){
        // 表格行点击选中切换
        $('#flexigrid >table>tbody>tr').click(function(){
            $(this).toggleClass('trSelected');
        });
        $('#user_count').empty().html("{$pager->totalRows}");
    });
    function changeState(id,state,obj) {
        // 删除按钮
        layer.confirm('确认该操作？', {
            btn: ['确定', '取消'] //按钮
        }, function () {
            $.ajax({
                type: 'post',
                url: '/index.php?m=Admin&c=Distribut&a=changeState',
                data: {id : id,state:state},
                dataType: 'json',
                success: function (data) {
                    layer.closeAll();
                    if (data.status == 1) {
                        $(obj).parent().parent().remove();
                        $(obj).parent().parent().parent().find('.statename').html(data.data);
                    } else {
                        layer.alert(data.msg, {icon: 2});
                    }
                }
            })
        }, function () {
        });
    }
</script>